uid()
{
arrarySu=`find / -perm -4000 2>/dev/null `
echo "sgid files:"
j=0
for i in $arrarySu; do
	echo $j   $i
	((j+=1))
done
}
sgid(){
arrarySg=`find / -perm -2000 2>/dev/null`
echo "sgid files:"
j=0
for i in $arrarySg; do
	#statements
	echo $j   $i
	((j+=1))
done
}
if [ `id -u` -ne 0 ]; then
	#statements
	echo "please use root user!"
	sudo dirname $0
fi
end=y
while [ $end == y ]; do
clear
echo "					chengmaoyu xiaoxiao qiuyunfen publisher"
echo ""
echo ""
echo ""
echo "		a.Lists suid files."
echo ""
echo ""
echo "		b.Lists sgid files."
echo ""
echo ""
echo ""
echo "		enter 'e' end this program!"
echo ""
echo ""
echo ""
echo "Enter( a or b or e ) to choose:"
bool=0
while [ $bool -eq 0 ]; do
read choose
	#statements
if [ $choose == 'e' ]; then
	exit
fi
if [ $choose == 'a' ]; then
	#statements
	bool=1
	suid
elif [ $choose == 'b' ]; then
		#statements
		bool=2
		sgid
	else
		echo "enter is wrong!"
		echo "please enter again:"
fi
done
echo "Enter the need to get rid of the file number."
read -a fileNumber
arrarySu=($arrarySu)
arrarySg=($arrarySg)
if [ $bool -eq 1 ]; then
	for i in $fileNumber; do
		#statements
		sudo chmod u-s ${arrarySu[$i]} && echo "modify ${arrarySu[$i]} successful!"
	done
else 
	for i in $fileNumber; do
		#statements
		sudo chmod u-s ${arrarySu[$i]} && echo "modify ${arrarySu[$i]} successful!"
	done
fi
echo "continue?(y/n)"
read end
done

